package _22作业.File类;

import com.sun.jdi.PathSearchingVirtualMachine;

import java.io.File;

public class T1 {
    public static void main(String[] args) {
        File file1 = new File("D:\\TestFile\\test1.txt");
        File file2 = new File("D:\\TestFile\\测试目录");

        String file1AbsolutePath = file1.getAbsolutePath();
        System.out.println("text1.txt的绝对路径" + file1AbsolutePath);
        String file2AbsolutePath = file2.getAbsolutePath();
        System.out.println("测试目录的绝对路径" + file2AbsolutePath);

        System.out.println("file1的文件名 = " + file1.getName());
        System.out.println("file2的目录名名 = " + file2.getName());

        System.out.println("file1是否存在 = " + file1.exists());
        System.out.println("file2是否存在 = " + file2.exists());

        System.out.println("file1是文件？ " + file1.isFile());
        System.out.println("file2是文件？ " + file2.isFile());
        System.out.println("file1是文件夹？ " + file1.isDirectory());
        System.out.println("file2是文件夹？ " + file2.isDirectory());



    }
}
